## Luke Snyder
## Assignment 5


def statement(n, source, dest):
   print 'move disk %s from %s to %s' % (str(n), source, dest)

def hanoi(n, dest, source, temp):
   if n == 0:
	   return
   hanoi(n-1, temp, source, dest)
   statement(n, source, dest)
   hanoi(n-1, dest, temp, source)

def main():
	n = input ('Please enter the number of disks: ')
	source = raw_input ('Please enter the name of the first peg: ')
	temp = raw_input ('Please enter the name of the middle peg: ')
	dest = raw_input ('Please enter the name of the last peg: ')
	print
	hanoi(n, dest, source, temp)

if __name__ == "__main__":
	main()
	print
	print
	main()
	print
	print 
	main()

